package com.fjl.file.apk;

import java.io.File;
import java.io.IOException;

import com.mcxiaoke.packer.common.PackerCommon;

public class ReadApkMsg
{

	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		File file  = new File("F:/MapGISExplorer.apk");
//		File file  = new File("C:/packV2.apk");
//		File file  = new File("C:/第三次土地利用外业调查系统20180816未上传.apk");
//		File file  = new File("C:/MapGISExplorer.apk");
		try
		{
			String packageStr = PackerCommon.readChannel(file);
			System.out.println(packageStr);
			
			
			String[] strs = packageStr.split("/n");
			System.out.println(strs[0]);
			
			if(strs.length == 2)
			{
				System.out.println(strs[1]);
			}
			else if(strs.length > 2)
			{
				System.out.println(strs[1]);
				System.out.println(strs[2]);
			}
			else
			{
				System.out.println("nothing");
			}
		}
		catch (IOException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		try
		{
			String readStr = PackerCommon.readString(file, PackerCommon.CHANNEL_BLOCK_ID);
			System.out.println(readStr);
		}
		catch (IOException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

}
